package com.oct.ywsc.core.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Data
@ConfigurationProperties(prefix = "spring.kafka.producer")
@Configuration
public class KafkaProducerConfig extends KafkaSaslConfig {

    /**
     *     producer:
     *       bootstrap-servers:
     *         - 10.0.11.47:9092
     *       # # 消息重发的次数。 配置事务的话：如果用户显式地指定了 retries 参数，那么这个参数的值必须大于0
     *       retries: 1
     *       #一个批次可以使用的内存大小
     *       batch-size: 16384
     *       # 设置生产者内存缓冲区的大小。
     *       buffer-memory: 33554432
     *       key-serializer: org.apache.kafka.common.serialization.StringSerializer
     *       value-serializer: org.apache.kafka.common.serialization.StringSerializer
     */
    private List<String> bootstrapServers;

    private Integer retries;
    private Integer batchSize;
    private Integer bufferMemory;
    private String keySerializer;
    private String valueSerializer;


    /**
     *       enable-security: true
     *       security-protocol: "SASL_SSL"
     *       sasl-mechanism: PLAIN
     *       sasl-jaas-config: org.apache.kafka.common.security.plain.PlainLoginModule required username='e05b4959-0a72-4e42-8600-bbf2733415bb' password='6128e258c7d3c98c0b8e07b2142407c439c5965678c541e10f162b33a91f9be6';
     *       ssl-truststore-location: /Users/ywsc/Documents/workspace/ywsc/ywsc-server/src/main/resources/kafka.client.truststore.jks
     *       ssl-truststore-password: 123456
     *       ssl-endpoint-identification-algorithm: none
     */


}
